package com.njtoyo.netrides.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by astropete on 2018/3/26.
 */
public class Znum {

    public enum RState {
        waiting,
        contracted,
        pickuping,
        started,
        ended,
        completed,
        marked,
        cancelled,
        forcecancelled,
        inarea
    }

    public enum OState {
        init,
        operated,
        done,
        cancelled,
        failed,
        rejected,
        front_end_done
    }

    public enum SaleCtg {
        random_award,
        coupon,
        redpacket,
        voucher,
        merchant,
        collect,
        ref_random_prize
    }

    public enum CouponCtg {
        mix,
        reduction,
        fullreduction,
        discount
    }

    public enum MarketingTrigger {
        other,                              //其他
        onlineorder,                        //线上接单奖励
        redpacket,                          //红包
        wxapp_recommend,                    //小程序推广
        app_recommend,                      //APP推广
        app_recommend_and_first_order,      //APP推广乘客激活以及乘客首单支付奖励
        scan_recommend,                     //扫码推广
        wxmina_scan_recommend,               //小程序扫码推广
        old_simple_order               //助老屏电召司机奖励
    }

    public enum MarketingCtg {
        redpacket,
        merchant
    }

    public enum DriverMarketingCtg {
        other,          //
        onlineorder,    //线上订单
        redpacket,      //红包
        recommend,      //推广
        first_order     //乘客完成首单
    }

    public enum PayThrough {
        unknown,
        cash,
        online,
        wxapp,
        wechat,
        alipay,
        saving,
        redpacket,
        jybwxapp,
        point,
        mixed,
        unionpay
    }

    public enum SPCtg {
        unknown,
        invite,                     //邀请
        ride,                       //行程
        rideorder,                  //行程订单
        customerPromoter,           //推广者
        invite_activity_team        //邀请组队
    }


    public enum CommentCtg {
        taxinotiming
    }

    public enum CustomerPointCtg {
        recharge,
        payment,
        shopping
    }

    public enum OperationMode {
        add,
        reduct
    }

    public enum GoodsCtg {
        coupon,
        product,
        shopTicket
    }

    public enum GoodsStatus {
        online,
        offline
    }

    public enum GoodsTradeMethod {
        point,
        money,
        mixed,
        activity
    }

    public enum CustomerPointStatus {
        valid,
        invalid,
        payment
    }

    public enum SellerValidStatus {
        unchecked,
        checked,
        unknown
    }

    public enum RechargePayMode {
        saving,
        payment,
        penalty,
        redpack
    }

    public enum OrderType {
        rideOrder,
        cancellation
    }

    public enum SellerTicketCtg {
        limit,
        unlimited
    }

    public enum CustSellerTicketState {
        unchecked,
        checked
    }

    public enum LinkCtg {
        webredirect,
        inappredirect,
        view
    }

    public enum LogLevel {
        info,
        error
    }

    public enum LogType {
        base
    }

    public enum Device {
        ios,
        android
    }

    public enum useGroup {
        driver,
        user
    }

    public enum RoleLevel {
        admin,
        emp
    }

    public enum SellerAccountState {
        active,
        inactive
    }

    public enum SellerActivityChannel {
        unknown,
        share,
        ride,
        h5,
        point
    }

    public enum SellerActivityCtg {
        unknown,
        ticket,
        goods
    }

    public enum SellerActivityStatus {
        online,
        offline
    }

    public enum FlowCtg {
        income,     //收入
        expense      //支出
    }

    public enum DriverFlowAccountCtg {
        unknown,
        order,                  //订单车费
        h5_order,               //扫码车费
        promotion,              //推广奖励
        redpack,                //红包奖励
        withdraw,               //提现
        customer_fine,          //用户有责取消罚金收入
        rebate,                 //司机现金返利
        promotion_first_order,  //司机推广的乘客完成首单
        online_order_reward,    //司机线上接单奖励
        admin_deduction,        //平台扣款
        scan_ride_order         //扫码车费
    }

    public enum CustomerChannel {
        wxmina,         //微信小程序
        app,            //APP
        h5,             //h5网页
        webkit_qct,     //全澄通
        h5Market,       //h5本地生活
        h5_sale,        //h5营销注册
        webkit_tzykt    //泰州一卡通注册
    }

    public enum AppointmentPick {
        nopick, //数据库为：waiting 等待接单
        pick,
        cancelled,
        covered
    }

    public enum AppointmentCtg {
        shortAppointment,
        longAppointment
    }

    //小心！如果改动此值时请注意TaxiCallServiceImpl中的switch case判断
    public enum RideCtg {
        realtime,
        appointment,
        assign
    }

    public enum RListState {
        all,//全部
        paid,//已支付
        unpaid,//未支付
        cancelled//已取消
    }

    public enum DriverEventCtg {
        waiting,//开始听单
        contracted,//抢单
        started,//接到乘客
        ended,//送至目的地
        outarea,//离开运营范围
        overspeed//超速
    }

    public enum AcceptCallCtg {
        all,
        onlyRealtime,
        onlyAppointment
    }

    public enum CouponScope {
        mix,            //通用
        realtime,       //仅限实时单可用
        appointment     //仅限预约单可用
    }

    public enum CouponPlatform {
        mix,        //通用
        app,        //仅app可用
        wxmina,     //仅小程序可用
        h5,         //仅h5可用
    }

    public enum MemberCategory {
        driver,     //司机
        customer,   //用户
        merchant,   //商家
        promoter    //推广者
    }

    public enum ActiveState {
        inactive,   //未激活
        active,     //激活
        freeze_up   //冻结
    }

    public enum MemberLevel {
        none,   //无等级
        one,    //一级
        two,    //二级
        three   //三级
    }

    @Getter
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum TriggerEvent {
        customer_taxi("乘客打车消费"),
        customer_merchant("乘客商城消费"),
        recommend_customer("推荐乘客"),
        recommend_driver("推荐司机"),
        recommend_merchant("推荐商家"),
        recommend_commodity("分享商品"),
        consume("消费"),
        driver_taxi("司机接单"),
        driver_merchant("司机商城消费"),
        driver_get_praise("司机得好评"),
        customer_register_coupon("新用户注册发放优惠券");
        private final String title;

        TriggerEvent(String title) {
            this.title = title;
        }

        public String getName() {
            return name();
        }
    }

    public enum UsageCondition {
        FULL,   //满减
        MAX     //折扣
    }

    public enum WebPagePlatform {
        all,        //全平台
        ios,        //ios
        android     //安卓
    }

    public enum RefCategory {
        ride_order,
        street_ride_order,
        scan_ride_order
    }

    public enum CustomerRewardCtg {
        coupon,     //优惠券
        voucher     //余额
    }

    public enum BenefitTrigger {
        sign_up     //推荐注册
    }

    public enum RealtimeCategory {
        realtime,
        assign
    }

    public enum CouponDiscountType {
        reduction,  //减免
        discount    //折扣
    }

    public enum ActivityWaveAllowanceTriggerBy {
        none,                //无触发机制
        app_online_order,    //app端行程线上支付
        wxmina_online_order  //小程序线上支付
    }

    public enum CustomerNotifyStyle {
        reddot,     //小红点
        bubble      //气泡
    }

    public enum CustomerMenuPosition {
        index       //首页
    }

    public enum DriverMsgLinkCategory {
        self,           //跳转内部页面
        h5,             //H5页面
        advertise       //广告
    }

    public enum DriverMsgEventCategory {
        ride_order,                         //行程车费
        cancel_order,                       //违约金
        peak_order_reward,                  //司机高峰接单奖励
        online_red_packet,                  //司机线上接单红包
        recommend_registration,             //推荐注册
        recommend_general_activation,       //推荐激活(激活即产生奖励，非首单需求)
        recommend_combine_activation,       //推荐激活奖励(乘客完成首单有额外奖励)
        recommend_combine_first_order,      //司机推荐的乘客完成首单
        marketing_rebate,                   //本地生活返利
        appointment,                        //预约单开始前提醒
        withdraw,                           //提现
        deduct,                             //平台扣钱
        system,                             //系统通知
        scan_ride_order,                    //扫码行程车费
        simple_call_ride_order              //一键叫车行程车费
    }

    public enum DriverBroadcastMsgCategory {
        peak_order_reward       //高峰接单奖励
    }

    /**
     * 本地生活返利相关枚举
     */
    public enum EventRefTypeEvent {
        ride_order,                             //行程订单
        ride_marking,                           //司机好评
        member_recommendation,                  //上下级推荐表
        merchant_member_order,                  //商城消费
        merchant_review,                        //推荐商家
        recharge,                               //乘客充值
        merchant_commodity_recommendation       //分享商品（无上下级关系）
    }

    public enum DriverInformationReviewCtg {
        plate_number,           //车牌号
        driver_name,            //司机姓名
        company,                //公司
        mobile_number           //手机号
    }

    public enum DriverState {
        frozen,     //冻结
        left        //离开
    }

    public enum RegistrationChannel {
        ios,        //ios
        android     //安卓
    }

    public enum CustomerUUID {
        unknown,    //未知
        unique,     //唯一
        not_unique  //不唯一
    }

    public enum CustomerRewardScene {
        sign_up_coupons,    //注册优惠券包
        scan_discount        //扫码立减
    }

    public enum ScanOrderPaymentChannel {
        ali_pay,        //支付宝
        wx_pay,         //微信
        union_pay,      //云闪付
        wxmina          //小程序
    }

    public enum SaleRegistration {
        yan_cheng_sale          //盐城营销注册
    }

    public enum DriverSpecialRewardCategory {
        recommend_red_packet        //推广抽接单红包
    }

    public enum DriverSpecialRewardType {
        random_driver,  //随机司机
        random_time     //随机时间
    }

    public enum ActivityRewardCtg {
        coupon
    }

    public enum CouponSourceChannel {
        system,         //平台发放
        activity_team   //助力活动获得
    }


    public enum GapCtg {
        day
    }

    public enum ScanPlatform {
        app,        //APP
        wxmina      //小程序
    }

    public enum DriverTimeState {
        inservice,      //出车
        working,        //出车中
        offduty         //收车
    }

    public enum ScanRideValidateErr {
        previous_customer,  //老用户
        duplicate_uuid,     //重复的uuid
        distance_far,       //距离过远
        continuous_area,    //相同区域
        once_discounted,     //一次折扣
        no_sale,                //没有活动
        non_authorize_locate,
        had_order,
        not_in_same_region,
        lowest_price_not_met    //未达到最低价格
    }

    public enum DialFrom {
        driver,
        customer
    }

    public enum DriverServiceCategory {
        driver_mark,                    //司机评价分
        grab_call_weight,               //司机抢单权重
        payment_rate_pass,              //免手续费配置
        close_automatic_ride_grab       //关闭司机自动抢单配置
    }

    public enum PassRideCategory {
        all,        //所有行程
        ride,       //正常行程
        scan_ride   //扫码行程
    }

    public enum PassPlatform {
        all,
        app,
        wxmina
    }


    public enum CustomerServiceCategory {
        customer_recharge,   //乘客充值
        contact_number,   //客服电话
        realtime_call_rule   //实时单呼叫规则
    }

    public enum ScoreInOut {
        add,    //加分
        deduct  //减分
    }

    public enum ScoreLogCategory {
        ride_marking,       //行程评价
        score_deduct        //司机扣分
    }

    public enum ThresholdState {
        unknow,         //预热
        greater,        //司机分数高于等于阈值
        less            //司机分数低于阈值
    }

    public enum ThresholdCategory {
        auto_grab   //自动抢单
    }

    @Getter
    @AllArgsConstructor
    public enum CustomerCancelReasonCategory {
        system("系统原因"),     //系统原因
        driver("司机原因"),     //司机原因
        customer("自己原因"),   //乘客自身原因
        other("其他原因");       //其他原因
        private String description;

    }

    public enum SuspiciousRideSystemJudgment {
        distance_exceeded,      //行程超出距离
        time_exceeded,          //行程超过时间
        customer_report         //乘客举报司机

    }

    public enum SuspiciousRideAdminJudgment {
        none,      //无异常
        had        //有异常
    }

    public enum ValidateErr {
        previous_customer(0, "您已注册过有滴打车"),  //老用户
        duplicate_uuid(1, "您的设备被使用过"),     //重复的uuid
        distance_far(2, "司机涉嫌违规"),       //距离过远
        continuous_area(3, "司机涉嫌违规"),    //相同区域
        once_discounted(4, "您已使用过该优惠"),     //一次折扣
        no_sale(5, "没有活动"),                //没有活动
        non_authorize_locate(6, "乘客没有打开定位"),
        had_order(7, "不能使用立减优惠"),
        not_in_same_region(8, "司机和乘客不在同一运营区"),
        lowest_price_not_met(9, "未达到最低价格");

        private String description;
        private Integer code;

        ValidateErr(Integer code, String description) {
            this.description = description;
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public Integer getCode() {
            return code;
        }
    }

}
